import { useState, useEffect } from 'react';
import CreateCheckupRecord from '../components/CreateCheckupRecord';
import { getPatientInfoSingle } from '@/pages/Patriarch/ChildrenRecord/service';
const Detail = ({ location }) => {
  const { id, patientId } = location.query;
  const [info, setInfo] = useState();

  const queryPatientInfoSingle = async () => {
    if (!patientId) return;
    const res = await getPatientInfoSingle({ patientId });
    setInfo(res);
  };

  useEffect(() => {
    queryPatientInfoSingle();
  }, []);
  return <CreateCheckupRecord recordId={id} info={info} />;
};

export default Detail;
